package lex.java.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.ListIterator;

public class ListIteratorTest {
	public static void main(String[] args) {
		List<Integer> tmp = Arrays.asList(0, 10, 20, 30, 40, 50);
		List<Integer> list = new ArrayList<Integer>();
		list.addAll(tmp);

		ListIterator<Integer> iter = list.listIterator(list.size());
		iter.add(25);
		for (; iter.hasNext();) {
			System.out.print(iter.next() + " ");
		}
		System.out.println();
		System.out.println(list);
	}
}
